package com.wyz.saas.common.map.manager

import android.graphics.Bitmap
import android.view.View
import androidx.fragment.app.Fragment
import com.atom.annotation.Impl
import com.saop.annotation.AopLog
import com.wyz.saas.api.app.ApiButton
import com.wyz.saas.common.R
import com.wyz.saas.common.impl.AbstractIconButton

@Impl(
    api = ApiButton::class,
    name = MapOverlayerManagerButton.IMPL_NAME
)
class MapOverlayerManagerButton : AbstractIconButton() {

    companion object {
        const val IMPL_NAME = "Overlayer"
    }

    override fun getName(): String {
        return IMPL_NAME
    }

    override fun getLabel(): String {
        return IMPL_NAME
    }

    override fun getBitmap(): Bitmap? {
        return decodeResource(R.mipmap.icon_overlayer_manager)
    }

    @AopLog(tag = "MapOverlayerManagerButton")
    override fun onViewClick(fragment: Fragment?, view: View) {
        super.onViewClick(fragment, view)
        fragment?.also {
           //loadFragment(it, MapOverlayManagerFragment<>(), true)
        }
    }

    override fun isMenuButton(): Boolean {
        return true
    }
}